import threading

def hello():
    print("hello, world")
    # 循环调用,执行定时任务
    timer = threading.Timer(3, hello)
    timer.start()

# 经过3秒之后t再执行,单位秒
t = threading.Timer(3, hello)
t.start()